
from util.selenium.webdriver.common.by import By

from base.BaseMethod import BM
from util.DataQuery.FormDataDecorator import FormDataDecorator


class WriteHRSubinfo():
    ent_doctor_loc = (By.CSS_SELECTOR, 'input#entHrDoctor')
    ent_master_loc = (By.CSS_SELECTOR, 'input#entHrMaster')
    ent_bachelor_loc = (By.CSS_SELECTOR, 'input#entHrBachelor')
    ent_junior_loc = (By.CSS_SELECTOR, 'input#entHrJunior')
    ent_senior_loc = (By.CSS_SELECTOR, 'input#entHrSenior')
    ent_middle_loc = (By.CSS_SELECTOR, 'input#entHrMiddle')
    ent_primary_loc = (By.CSS_SELECTOR, 'input#entHrPrimary')
    ent_mechanic_loc = (By.CSS_SELECTOR, 'input#entHrMechanic')
    ent_age1_loc = (By.CSS_SELECTOR, 'input#entHrAge1')
    ent_age2_loc = (By.CSS_SELECTOR, 'input#entHrAge2')
    ent_age3_loc = (By.CSS_SELECTOR, 'input#entHrAge3')
    ent_age4_loc = (By.CSS_SELECTOR, 'input#entHrAge4')

    def __init__(self, driver=None):
        self.driver = driver
    @property
    def class_name(self):
        return self.__class__.__name__


    @FormDataDecorator
    def write_hr_subinfo(self, doctor=None, md=None, bd=None, coll=134, senior=3, medium=59, primary=192, snengr=140, age30al=270, age40al=87, age50al=33, age51au=4):

        BM.input(ele_loc=self.ent_doctor_loc, driver=self.driver, keys=doctor)
        BM.input(ele_loc=self.ent_master_loc, driver=self.driver, keys=md)
        BM.input(ele_loc=self.ent_bachelor_loc, driver=self.driver, keys=bd)
        BM.input(ele_loc=self.ent_junior_loc, driver=self.driver, keys=coll)
        BM.input(ele_loc=self.ent_senior_loc, driver=self.driver, keys=senior)
        BM.input(ele_loc=self.ent_middle_loc, driver=self.driver, keys=medium)
        BM.input(ele_loc=self.ent_primary_loc, driver=self.driver, keys=primary)
        BM.input(ele_loc=self.ent_mechanic_loc, driver=self.driver, keys=snengr)
        BM.input(ele_loc=self.ent_age1_loc, driver=self.driver, keys=age30al)
        BM.input(ele_loc=self.ent_age2_loc, driver=self.driver, keys=age40al)
        BM.input(ele_loc=self.ent_age3_loc, driver=self.driver, keys=age50al)
        BM.input(ele_loc=self.ent_age4_loc, driver=self.driver, keys=age51au)
